package com.hxzy.service.impl;

import com.hxzy.dao.BooksDao;
import com.hxzy.dao.impl.BookDaoImpl;
import com.hxzy.service.BooksService;
import entity.Books;

import java.util.Optional;

public class BooksServiceImpl implements BooksService {
    private BookDaoImpl bookDao= new BookDaoImpl();
    @Override
    public int insert(Books books) {
        return bookDao.insert(books) ;
    }

    @Override
    public int updateByPrimaryKey(Books books) {
        return bookDao.updateByPrimaryKey(books);
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return bookDao.deleteByPrimaryKey(id);
    }

    @Override
    public Optional<Books> selectByPrimaryKey(Integer id) {
        Optional<Books> optional = bookDao.selectByPrimaryKey(id);
        return optional;
    }
}
